package leetcode.treeCode.week3.leetcode_404;



class Solution {
    public int sumOfLeftLeaves(TreeNode root) {
        return dfs(root);
    }
    public int dfs (TreeNode node){
        if (node == null ) return 0;
        int sum = 0;
        if (node.left != null&& node.left.left == null && node.left.right == null){
        sum  += node.left.val;
        }
        return sum + dfs (node.left) + dfs (node.right);
    }
}